import {SAVEBOX} from '../constant'
/**
 * {"id": ["TN", "YSX"],
 * "box": [[0.2412010282278061, 0.25996705889701843, 0.333015501499176, 0.45455625653266907],
 *  [0.7110262513160706, 0.35581862926483154, 0.7409855127334595, 0.4185703694820404]]
 *}
 */
const initState = ({
    id:[],
    box:[]
})
export default function countReducer(preState=initState,action){
    console.log("@@@@count");
    //从action对象中获取: type,data
    const {type, data} = action
    //根据type决定如何加工数据
    switch (type){
        case SAVEBOX://如果是加
            return  data
        default:
            return preState
    }
}